<?php


namespace app\crm\validate;


use think\Validate;

/**
 * Class Article
 * @package app\admin\validate
 */
class MedicalRecords extends Validate
{

    /**
     * 验证规则
     * @var string[]
     */
    protected $rule = [
        'id'          => 'require|number|gt:0',
        'customer_id' => 'require|gt:0',
        'customer_name'        => 'require',
        'customer_sex'        => 'require',
        'customer_birth_date' => 'require',
        'case_no'        => 'require',
        'treatment_date'      => 'require',
        'doctor_id' => 'require|gt:0',
        'case_type'        => 'require|gt:0',
        'principle_action'      => 'require',
        'previous_allergy_history' => 'require',
        'now_medical_history'        => 'require',
        'previous_history'      => 'require',
        'family_history'        => 'require',
        'skin_examine'      => 'require',
        'auxiliary_examine'        => 'require',
        'diagnose_category_one'      => 'require|gt:0',
        'diagnose_category_two'        => 'require|gt:0',
        'diagnose_category_three'      => 'require|gt:0',
        'advice_doctor'      => 'require',
        'therapeutic_schedule'      => 'require',

    ];

    /**
     * 错误信息
     * @var string[]
     */
    protected $message = [
        'id.require'          => '病例参数错误',
        'id.number'           => '病例参数错误',
        'id.gt'               => '病例参数错误',
        'customer_id.require'          => '顾客参数错误',
        'customer_id.gt'           => '顾客参数不合法',
        'customer_name.require'               => '顾客姓名必填',
        'customer_sex.require'          => '性别必填',
        'customer_birth_date.require'           => '出生日期必填',
        'case_no.require'           => '请填写病例编号',
        'case_type.require'        => '就诊状态参数错误',
        'case_type.gt'        => '就诊状态不合法',
        'principle_action.require'      => '请填写主诉',
        'previous_allergy_history.require' => '请填写既往过敏史',
        'now_medical_history.require'        => '请填写现病史',
        'previous_history.require'      => '请填写既往史',
        'family_history.require'        => '请填写家族史',
        'skin_examine.require'      => '请填写辅助检查',
        'auxiliary_examine.require'        => '请填写辅助检查',
        'diagnose_category_one.require'      => '请选择诊断类目一',
        'diagnose_category_one.gt'      => '诊断类目一参数不合法',
        'diagnose_category_two.require'      => '请选择诊断类目二',
        'diagnose_category_two.gt'      => '诊断类目二参数不合法',
        'diagnose_category_three.require'      => '请选择诊断类目三',
        'diagnose_category_three.gt'      => '诊断类目三参数不合法',
        'advice_doctor.require'      => '请填写医嘱',
        'therapeutic_schedule.require'      => '请填写治疗方案',

    ];

    /**
     * 验证场景
     * @var string[]
     */
    protected $scene = [
        'create' => ['customer_id','doctor_id'],
        'update' => ['customer_id', 'doctor_id'],
        'detail' => ['id']
    ];

}
